package com.antcom.antread.antreadmodules.antreadsystem.log.dao;

import com.antcom.antread.api.domain.OperationLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * Dao: log
 *
 * @Author 中国蚂蚁技术有限公司
 * @create 2020/12/25 22:16
 */
@Mapper
public interface OperationLogMapper {

    /**
     *  保存日志
     *
     * @param operationLog 日志
     */
    @Transactional(rollbackFor = Exception.class)
    void save(OperationLog operationLog);

    /**
     *  根据id 查询详情
     *
     * @param operId
     * @return
     */
    OperationLog findOne(String operId);

    /**
     *  根据id 删除
     *
     * @param operId
     * @return
     */
    int deleteById(String operId);

    /**
     *  分页
     *
     *
     * @param sortMap 排序
     * @param startNum 开始条数
     * @param endNum 结束条数
     * @return
     */
    List<OperationLog> findAllPage(@Param("sortMap") String sortMap,@Param("startNum") Integer startNum,@Param("endNum") Integer endNum);

}
